package tgc.edu.examxy.repository;

import java.util.List;
import java.util.UUID;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import tgc.edu.examxy.custom.CommonRepository;
import tgc.edu.examxy.entity.Student;
import tgc.edu.examxy.entity.TbClass;
@Repository
public interface StudentRepository extends CommonRepository<Student, UUID>{

	public Student findByUsername(String idcode);

	public List<Student> findByTbClass(Object tbc);

	public Student findByOpenid(String openid);

	public Student findByType(String string);

	public Student findByTypeAndUsername(String string, String username);

	public Student findByOpenidAndType(String openid, String string);

	public Student findByTypeAndOpenid(String string, String openid);

	public List<Student> findByTbClassAndTypeAndIsUsed(TbClass tbClass, String string, boolean b);

	@Query(value="select count(*) from STUDENT where TB_CLASS_ID=?1",nativeQuery=true)
	public String manStudent(UUID id);


}
